//
//  UIColor+Utils.m
//  JuWangKeClientApp
//
//  Created by Jzy on 15/11/26.
//  Copyright © 2015年 Jzy. All rights reserved.
//

#import "UIColor+Utils.h"

@implementation UIColor (Utils)

+ (UIColor*)colorWithHex:(NSString *)hexValue alpha:(CGFloat)alphaValue
{
    char *stopstring;
    long hex = strtol([hexValue cStringUsingEncoding:NSUTF8StringEncoding], &stopstring, 16);
    return [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0
                           green:((float)((hex & 0xFF00) >> 8))/255.0
                            blue:((float)(hex & 0xFF))/255.0 alpha:alphaValue];
}

+ (UIColor*)colorWithHex:(NSString *)hexValue{
    return [self colorWithHex:hexValue alpha:1.0];
}

@end
